<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <h3>1.{{}}双大括号输出文本内容</h3>
        <!-- 文本表达式 -->
        <p>{{msg}}</p>
        <!-- js表达式 -->
        <p>{{score+1}}</p>
        <h3>2.一次性插值 v-once</h3>
        <span v-once> {{msg}}</span>

        <h3>3.指令输出真正的HTML内容</h3>
        <p> 双大括号：<span>{{contentHtml}}</span></p>
        <p> v-html:<span v-html="contentHtml"></span></p>
        <h3>4.元素绑定指令 v-bind</h3>
        <img :src="imgUrl" alt="">
        <img v-bind:src="imgUrl" alt="">
        <a :href="baiduUrl">dsa</a>
        <h3>5.事件绑定指令 v-on</h3>
        <input type="text" v-model="num">
        <button v-on:click="add">点击+1</button>


    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                msg: "dsf",
                score: 100,
                contentHtml: '<span style="color:green">dsgjgsd</span>',
                imgUrl: "https://ali.image.hellorf.com/images/bece50c19904f8d1e1c6f861dabec3c1.jpeg?x-oss-process=image/resize,h_400/format,webp",
                baiduUrl: "https://www.baidu.com",
                num: 1

            },
            methods: {//指定事件处理函数
                add: function () {
                    this.num++;
                }
            }
        })
    </script>

</body>

</html>